<!--单选-->
<template>
    <el-radio-group v-model="inputvalue" @change="inputvalueChangge">
        <el-radio 
            v-for="item in list.options" 
            :key="item.value" 
            :label="item.value"
        >
        {{backTitle(item['title_'+lang])}}
        </el-radio>
    </el-radio-group>       
</template>

<script>
    import {backTitle} from "@/common/common";
    export default {
        components: {backTitle},
        props: ["list","lang","value",'isnone'],
        data() {
            return{
                inputvalue:[],
                backTitle:backTitle,
            }
        },
        mounted(){
           this.rulesList();
        },
        methods:{
            rulesList(){
                var arr = [];
                if(this.list.is_require==1){
                    arr.push({ required: true,message: this.$t('m.ChooseOne')+this.list['title_'+this.lang]})
                }
                this.$emit('changeRules',this.list.name,arr,this.isnone)
            },
            inputvalueChangge(){
                this.$emit('input',this.inputvalue)
            }
        },
        watch:{
            value:{
                handler(val,old){
                    console.log()
                    if(val != "" || val !=undefined){
                        this.inputvalue = val;
                    }
                },
                immediate:true,
                deep:true,
            }
        }
    }
</script>
<style lang="less">
    .input{
        width: 100%;
        .el-form-item.bordernone{
            border-bottom: none;
        }
        .el-form-item__content{
            .el-radio{
                display: block;
                line-height: 40px;
                font-size: 12px;
            }
            .el-checkbox__inner{
                border-radius: 50%;
            }
        }
    }
    
</style>